Chris Pollett > Old Classes >
CS157a

( Print View )

Grades: [Sec4]

Submit: [Sec4]

Course Info:
  [Texts & Links]
  [Topics]
  [Grading]
  [HW Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]

Practice Exams:
  [Mid1]  [Mid2]  [Final]

                            












HW#1 --- last modified January 01 1970 00:00:00..

Solution set.

Due date: Feb 6

Files to be submitted:
  Ch1Ch2Probs.txt
  EmailList.java
  Test4.java

Purpose: To start you thinking about the design problems that go into making a successful database or database management system. These problems include how the database should be broken into tables, what kind of queries will be made of the data, how to return answer sets for a query, how the target users can and will access the data.

Specification:

Do problems 1.7, 1.9, 2.10 out of ElMasri and Navathe. Submit these in the file Ch1Ch2Probs.txt. For the coding part of the assignment you will write a program called EmailList.java. Its purpose will be to return from a student record database all the names, e-mail addresses, and grades of students who belong to a given class. It will be run from the command line with a command like:

java EmailList CS3380

And would print to the screen lines like:

"Brown" "brown@yahoo.com" "A"
"Walter" "walter@flakey.net" "C-"
              .
              .
              .

This kind of program might be useful, for instance, for a professor to
e-mail students their grades. The student record database that will be used
for this assignment can be assumed to look like the one in Figure 1.2 out
of the book, but where we've added a column to the STUDENT table for e-mail 
addresses. Of course, each table will have many more rows of data than is 
represented in Figure 1.2. You can assume that these tables are stored in
ordinary files with names STUDENT, COURSE, SECTION, GRADE_REPORT, and
PREREQUISITE and that these files exist in the same directory as where
your program is run. Each line in these files represents one row of the table. 
For example, the first two rows of the file STUDENT will look like:
"Smith" "17" "1" "CS" "Smith@somewhere.com"
"Brown" "8" "2" "CS" "johnnie@hello.com"
Notice that each item is in quotes and that items in a row are separated by
spaces. This will be true of each of the files. This is pretty much all
you need to know to do this assignment, but there is one more thing you
should be concerned about: Do not assume any of the files in question
are small enough to fit entirely into the computer's memory at one time. 
Below is a breakdown by which this assignment will be graded.

Point Breakdown

Departmental coding guidelines for Java followed1pt
Problem 1.7 1pt
Problem 1.91pt
2.10 first question 1pt
2.10 second question 1pt
Command line argument is used appropriately1pt
The appropriate files are opened, read, and closed correctly; the appropriate exceptions are handled for file I/O1pt
Program runs correctly when tables have fewer than 100 rows2pt
Program runs correctly works when table size is very large1pt
Total10pts